﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>@ViewBag.SysTitle</title>
    <!-- 依 赖 样 式 -->
    <link rel="stylesheet" href="/pear/css/pear.css" />
    <!-- 加 载 样 式 -->
    <link rel="stylesheet" href="/css/loader.css" />
    <!-- 布 局 样 式 -->
    <link rel="stylesheet" href="/css/admin.css" />
</head>
<!-- 结 构 代 码 -->
<body class="layui-layout-body pear-admin">
    <!-- 布 局 框 架 -->
    <div class="layui-layout layui-layout-admin">
        <!-- 顶 部 样 式 -->
        <div class="layui-header">
            <!-- 菜 单 顶 部 -->
            <div class="layui-logo">
                <!-- 图 标 -->
                <img class="logo" />
                <!-- 标 题 -->
                <span class="title"></span>
            </div>
            <!-- 顶 部 左 侧 功 能 -->

            <ul class="layui-nav layui-layout-left">
                <li class="collapse layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
                <li class="refresh layui-nav-item"><a href="#" class="layui-icon layui-icon-refresh-1" loading=600></a></li>
            </ul>
            <!-- 多 系 统 菜 单 -->
            <div id="control" class="layui-layout-control"></div>
            <!-- 顶 部 右 侧 菜 单 -->
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item layui-hide-xs"><a href="#" class="menuSearch layui-icon layui-icon-search"></a></li>
                <li class="layui-nav-item layui-hide-xs"><a href="#" class="fullScreen layui-icon layui-icon-screen-full"></a></li>
                <!--<li class="layui-nav-item layui-hide-xs"><a href="#" class="layui-icon layui-icon-website"></a></li>-->
               <li class="layui-nav-item layui-hide-xs message"></li>
                <li class="layui-nav-item">
                    <!-- 头 像 -->
                    <a class="user" href="javascript:;"><img src="/Systems/User/GetProfilePicture" class="layui-nav-img"><span style="color:#1a1111;margin:0px 3px;font-size:16px;font-weight: bold;">@ViewBag.UserName</span></a>
                    <!-- 功 能 菜 单 -->
                    <dl class="layui-nav-child">
                        @if (ViewBag.UserId != "999999")
                        {
                            <dd><a user-menu-url="/systems/User/Detail" user-menu-id="5555" user-menu-title="基本资料">基本资料</a></dd>
                            <dd><a user-menu-url="/systems/User/ModifyPwd" user-menu-id="5556" user-menu-title="修改密码">修改密码</a></dd>
                        }
                        <dd><a href="javascript:void(0);" class="logout">注销登录</a></dd>
                    </dl>
                </li>

              <!-- 主 题 配 置 -->
			<li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>
            </ul>
        </div>
       <!-- 侧 边 区 域 -->
			<div class="layui-side layui-bg-black">
				<!-- 菜 单 顶 部 -->
				<div class="layui-logo">
					<!-- 图 标 -->
					<img class="logo">
					<!-- 标 题 -->
					<span class="title"></span>
				</div>
				<!-- 菜 单 内 容 -->
				<div class="layui-side-scroll">
					<div id="sideMenu"></div>
				</div>
			</div>
			<!-- 视 图 页 面 -->
			<div class="layui-body">
				<!-- 内 容 页 面 -->
				<div id="content"></div>
			</div>
			<!-- 页脚 -->
			<div class="layui-footer layui-text">
				<span class="left">
					通用系统管理后台.
				</span>
				<span class="center"></span>
				<span class="right">
                @Html.Raw( ViewBag.CopyRight)
                </span>
			</div>
			<!-- 遮 盖 层 -->
			<div class="pear-cover"></div>
			<!-- 加 载 动 画 -->
			<div class="loader-main">
				<!-- 动 画 对 象 -->
				<div class="loader"></div>
			</div>
		</div>
		<!-- 移 动 端 便 捷 操 作 -->
		<div class="pear-collapsed-pe collapse">
			<a href="#" class="layui-icon layui-icon-shrink-right"></a>
		</div>
    <!-- 依 赖 脚 本 -->
    <script src="/layui/layui.js"></script>
    <script src="/pear/pear.js"></script>

    <!-- 框 架 初 始 化 -->
    <script>
        layui.use(['lscom','admin', 'jquery', 'popup','drawer'], function () {
            var $ = layui.jquery;
            var admin = layui.admin;
            var popup = layui.popup;
            var lscom = layui.lscom;
          
            //admin.setConfigType("json");
            //admin.setConfigPath("/Configs/pear.config.json");
            //admin.render();
            var config = {
                "logo": {
                    "title": "@ViewBag.SysTitle",
                    "image": "@ViewBag.SysLogo"
                },
                "menu": {
                    "data": "/admin/GetMenu",
                    "collaspe": false,
                    "accordion": true,
                    "method": "GET",
                    "control": false,
                    "select": "0",
                    "async": true
                },
                "tab": {
                    "session": true,
                    "enable": @(ViewBag.MuiltTab ==1?"true":"false"),
                    "keepState": true,
                    "preload": true,
                    "max": 20,
                    "index": {
                        "id": "8000",
                        "href": "/admin/welcome?tag=@ViewBag.Tag",
                        "title": "首页"
                    }
                },
                "theme": {
                    "defaultColor": "@ViewBag.DefaultColor",
                    "defaultMenu": "dark-theme",
                    "defaultHeader": "light-theme",
                    "allowCustom": false,
                    "banner": false
                },
                "colors": [
                    {
                        "id": "1",
                        "color": "#2d8cf0",
                        "second": "#ecf5ff"
                    },
                    {
                        "id": "2",
                        "color": "#36b368",
                        "second": "#f0f9eb"
                    },
                    {
                        "id": "3",
                        "color": "#f6ad55",
                        "second": "#fdf6ec"
                    },
                    {
                        "id": "4",
                        "color": "#f56c6c",
                        "second": "#fef0f0"
                    },
                    {
                        "id": "5",
                        "color": "#3963bc",
                        "second": "#ecf5ff"
                    }
                ],
                "other": {
                    "keepLoad": 1200,
                    "autoHead": false,
                    "footer": @(ViewBag.SysFooter==1?"true":"false")
                },
                "header": {
                    "message": '/Systems/User/MseeageList'
                }
            }
            admin.render(config);

            // 登出逻辑
            admin.logout(function () {

                var waitIndex = layer.load(2);
                lscom.ajax({
                    url: "/Login/LoginOutAuth"
                }).done(function (data) {
                    popup.success("注销成功", function () {
                        setTimeout(function() {
                            location.href = "/Login/Loginout";
                        },1500)
                    })
                }).always(function () {
                    layer.close(waitIndex);
                });

               
                return true;
            });
            window.selectedWindow = function () {
                var  muilttab = localStorage.getItem("muilt-tab"); 
                if (muilttab=="true") {
                   return $(".layui-body .layui-tab-content .layui-show")[0].children[0].contentWindow;
                }else{
                   return $(".layui-body .pear-frame")[0].children[0].contentWindow;
                }
            }
           //消息点击回调
	       admin.message(function(id, title, context, form) {
              layer.open({
                    type: 2,
                    title: '通知公告详情',
                    shade: 0.1,
                    area: ['60%', '60%'],
                    content: '/Systems/Notice/Info' + lscom.utils.formatString("?id={0}", id),
                    btn: ['取消']
                });
           });
        });
    </script>
</body>
</html>
